In recent years, a shift-range changing device of an automatic transmission apparatus for a vehicle of a so-called shift-by-wire type has been researched and developed. For example, as disclosed in Japanese Patent Publications No. 2004-129451 and No. 2009-112151, a range-change operation of a vehicle driver (an operation of a shift lever) is detected by switches or the like and an electric motor is controlled based on a detection signal thereof so as to control a shift range of a range-change mechanism at a desired range position.
According to the above prior art apparatus (for example, JP No. 2009-112151, which corresponds to US 2009/0108791 A1), an encoder outputs a pulse signal for a predetermined angle in synchronism with rotation of an electric motor. When the shift range is changed, the output pulses from the encoder are counted and the electric motor is rotated based on a count value of an encoder counter (hereinafter, an encoder count value) to a target rotational position (corresponding to a target count value), so that a range position of the range-change mechanism is moved to a target range position.
In the electric motor of this kind having the encoder, it is only possible to detect a rotational amount (a rotational angle) of a rotor from its initial position based on the encoder count value after the start-up of the apparatus. It is, therefore, necessary to detect in some way an absolute rotational position of the rotor after the apparatus and/or system is turned on to start up its operation, in order to correct phase difference between the encoder count value and the rotational position of the rotor (corresponding to a current-supply phase). Otherwise, it is difficult to normally operate the electric motor.
According to the above prior art apparatus or system, current supply to stator coils of respective phases is sequentially changed in a open-loop control during an initial operation after the start-up of the apparatus or the system. In the above initial operation, since the current supply to the respective stator coils is carried out at least for one cycle at a predetermined time schedule, the rotational position of the rotor and a corresponding current-supply phase coincide with each other at one of the phases of the stator coils. The encoder count value at such a timing is memorized. A correction value for the phase difference (a correction value for initial-position difference) is calculated based on a relationship between the encoder count value at the end of the initial operation and the current-supply phase. In a subsequent normal operation of the electric motor, the encoder count value is corrected by the correction value for the phase difference so as to correctly supply electric power to the respective phases of the stator coils.
The motor control apparatus may happen to be automatically reset from any cause (for example, instantaneous drop of power supply voltage, electric power failure, noises and so on) during the normal operation after the initial operation. When such reset occurs, a learning value (a memorized value) for the correction value of the phase difference disappears. It becomes necessary to carry out a learning process again to calculate the correction value for the phase difference through the initial operation in a case that the apparatus or system is re-started after the reset.
In a normal start of the motor control apparatus after power supply, the initial operation is carried out in a condition that the rotor of the electric motor is stopped. In some of cases for re-starting the motor control apparatus after the reset thereof, the initial operation is carried out in a condition that the rotor of the electric motor is still being in rotation due to its inertia. When the initial operation is carried out in the condition that the rotor of the electric motor is being rotated, the rotor of the electric motor is continuously rotated by its inertia even if the rotational position of the electric motor does not correspond to phases of the electric motor to which the electric current is supplied. As a result, the learning process for the correction value of the phase difference may fail (for example, the learning process is ended due to an error, or a wrong value is learned), and motor operation cannot be normally carried out in a following motor control operation.
In addition to the above situation in which the motor control apparatus is automatically reset due to some reason during the normal operation of the electric motor, this kind of situation may also happen when a power source switch is turned on again shortly after the power source switch has been turned off but before the rotation of the electric motor has not yet been completely stopped.